/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 2446:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {


// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/RTF/RTF.vue?vue&type=template&id=84718a9c


function render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div"))
}
;// CONCATENATED MODULE: ./src/pages/RTF/utils/config.js
const blockTagNames = ['UL', 'OL', 'DIV', 'CODE', 'H1', 'QUOTE'];
const inlineTagNames = ['TEXT-COLOR', 'B', 'A', 'TEXT-BG']
const config_paraTagNames = ['P', 'LI'];
const baseParaTagName = 'P';
const autoCloseTagNames = ['IMG'];
const langNameList = [
  'html', 'xml', 'bash', 'c', 'cpp', 'csharp', 'css', 'markdown', 'diff',
  'ruby', 'go', 'graphql', 'java', 'javascript', 'json', 'kotlin',
  'less', 'lua', 'makefile', 'perl', 'objectivec', 'php', 'php-template',
  'python', 'python-repl', 'r', 'rust', 'scss', 'shell', 'sql', 'swift',
  'yaml', 'typescript'
].sort();

const childTagNameMap = new Map([
  ['UL', 'LI'],
  ['OL', 'LI']
])


;// CONCATENATED MODULE: ./src/pages/RTF/utils/fillStyle.js
function fillStyle_fillStyle(node, style) {
  if(!(node instanceof Node)) {
    console.error(`fill style: node-${node} is not a Node`);
    return;
  }

  if(typeof style !== 'object') {
    console.error(`fill style: style-${style} is not an object`);
    return;
  }

  Object.keys(style).forEach(key => {
    node.style[key] = style[key];
  })
}

function fillStyle_clearStyle(node, keys) {
  if(!(node instanceof Node)) {
    console.error(`clear style: node-${node} is not a Node`);
    return;
  }
  
  if(Array.isArray(keys)) {
    keys.forEach(key => {
      if(typeof key === 'string') {
        node.style[key] = undefined;
      } else {
        console.warn(`clear style: key-${key} is not a string, this will be ignored`);
      }
    })
  } else if(typeof keys === 'string') {
    node.style[keys] = undefined;
  } else {
    console.error(`clear style: unknown key ${keys}`);
  }
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/animation.js


function transparent(node) {
  if(!(node instanceof Node)) {
    console.error(`disappear: node-${node} is not a Node`);
    return;
  }

  fillStyle(node, {
    opacity: '0',
    pointerEvent: 'none'
  });
}

function untransparent(node) {
  if(!(node instanceof Node)) {
    console.error(`appear: node-${node} is not a Node`);
    return;
  }

  clearStyle(node, ['opacity', 'pointerEvent']);
}

function disappear(node) {
  if(!(node instanceof Node)) {
    console.error(`appear: node-${node} is not a Node`);
    return;
  }

  fillStyle_fillStyle(node, {
    display: 'none'
  });
}

function appear(node) {
  if(!(node instanceof Node)) {
    console.error(`disappear: node-${node} is not a Node`);
    return;
  }

  fillStyle_fillStyle(node, {
    display: 'block'
  });
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/highlight/index.js
const hljs = __webpack_require__(4712);

/* harmony default export */ const highlight = (hljs);
;// CONCATENATED MODULE: ./src/pages/RTF/utils/init/initLangSelect.js





// item
let langSelect, langTitle, langList;

// flag
let langListAppearFlag = false;

// listener 
function addLangSelectListener(node) {
  // default 'C'
  node.dataset.lang = 'C';
  for(let i = 0; i < node.children.length; i++) {
    let child = node.children.item(i);
    child.innerHTML = highlight.highlight(child.innerText, {
      language: 'C'
    }).value;
  }

  node.addEventListener('click', e => {
    e.stopPropagation();

    let rect = node.getBoundingClientRect();

    fillStyle_fillStyle(langSelect, {
      display: 'block',
      top: `${rect.top + 10}px`,
      left: `${rect.left + rect.width - 140}px`
    });
    langTitle.innerText = node.dataset.lang;

    langSelect.$el = node;
  })
}

function traceCode(node) {
  let codeParts = node.querySelectorAll('code');
  codeParts.forEach(code => {
    addLangSelectListener(code);
  })
}

function initLangSelect(node, codeBlockCallback) {
  if(!(node instanceof Node) || node.nodeType !== Node.ELEMENT_NODE) {
    return;
  }

  // clear node
  node.innerHTML = '';

  // DOM
  langSelect = node;
  langSelect.id = 'langSelect';
  langTitle = document.createElement('P');
  langTitle.id = 'langTitle';
  langList = document.createElement('UL');
  langList.id = 'langList';

  langSelect.appendChild(langTitle);
  langSelect.appendChild(langList);

  // animation
  disappear(langList);

  langSelect.addEventListener('click', e => {
    if(langListAppearFlag) {
      disappear(langList);
    } else {
      appear(langList);
    }
    langListAppearFlag = !langListAppearFlag;
    e.stopPropagation();
  });

  document.addEventListener('click', e => {
    disappear(langSelect);
  });

  // add list item
  langNameList.forEach(name => {
    let li = document.createElement('li');
    li.classList.add('lang-item');
    li.innerText = name.toUpperCase();
    langList.appendChild(li);

    li.addEventListener('click', event => {
      event.stopPropagation();
      langListAppearFlag = false;
      disappear(langList);
      langTitle.innerText = event.target.innerText;

      let codeBlock = langSelect.$el;

      if(!(codeBlock instanceof Node
        && codeBlock.nodeType === Node.ELEMENT_NODE)) return;

      if(typeof codeBlockCallback === 'function')
        codeBlockCallback(event.target.innerText, codeBlock);
    })
  })
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/assert.js




function isBlockNode(node) {
  if(!node || !(node instanceof Node)) {
    console.warn(`is block node: node-${node} is not a node, return false`);
    return false;
  }

  return blockTagNames.includes(node.tagName);
}

function assert_isEmptyNode(node) {
  if(!node || !(node instanceof Node)){
    console.error(`is empty node: ${node} is not a node`);
    return;
  }

  if(node.nodeType === Node.ELEMENT_NODE && autoCloseTagNames.includes(node.tagName)) {
    return false;
  } else if (node.nodeType === Node.ELEMENT_NODE && !node.childNodes.length) {
    return true;
  } else if (node.nodeType === Node.TEXT_NODE && node.nodeValue === '') {
    return true;
  } else if(node.nodeType === Node.ELEMENT_NODE) {
    let flag = true;
    node.childNodes.forEach(node => {
      if(!assert_isEmptyNode(node)) flag = false;
    });
    return flag;
  } else {
    return false;
  }
}

function isBlockFirstPara(node) {
  if(!node || !(node instanceof Node)) {
    console.warn(`is block first para: node-${node} is not a node, return false`);
    return false;
  }

  let block = findBlock(node);
  let para = findPara(node);

  return block.firstChild === para;
}

function ensureNewLine(node) {
  if(!node || !(node instanceof Node)) {
    console.error(`ensure new line: node-${node} is not a node, do nothing`);
    return;
  }

  if(!isBlockNode(node)) {
    console.error(`ensure new line: node-${node} is not a block, do nothing`);
    return;
  }

  if(!(node.lastChild instanceof Node) || !config_paraTagNames.includes(node.lastChild.tagName)) {
    let childTagName = childTagNameMap.get(node.tagName) || baseParaTagName;
    let newLine = document.createElement(childTagName);
    node.appendChild(newLine);
    newLine.appendChild(document.createTextNode(''));
  }
}

function ensureContent(node) {
  if(!node || !(node instanceof Node)) {
    console.error(`ensure content: node-${node} is not a node, do nothing`);
    return;
  }

  if(node.nodeType === Node.TEXT_NODE) return;
  if(assert_isEmptyNode(node)) {
    while(node.firstChild) node.removeChild(node.firstChild);
    node.appendChild(document.createTextNode(''));
  }
}

function assert_ensureSelectContent(range) {
  let r = range;
  let sc = r.startContainer, ec = r.endContainer,
    so = r.startOffset, eo = r.endOffset;

  if(sc.nodeType !== Node.TEXT_NODE) {
    if(so >= sc.childNodes.length) {
      setStartAfterLastContent(range, sc);
    }
    else {
      range_setStartBeforeFirstContent(range, sc.childNodes[so]);
    }
  }

  if(ec.nodeType !== Node.TEXT_NODE) {
    if(eo >= ec.childNodes.length) {
      range_setEndAfterLastContent(range, ec);
    }
    else {
      setEndBeforeFirstContent(range, ec.childNodes[eo]);
    }
  }
}

function ensureSelectPreContent(range) {
  let r = range;
  let sc = r.startContainer, ec = r.endContainer,
    so = r.startOffset, eo = r.endOffset,
    sp = findPara(sc), ep = findPara(ec);
  
  let sPreText = findPreviousContent(sc);
  let ePreText = findPreviousContent(ec);

  if(sc.nodeType === Node.TEXT_NODE && sPreText !== sc && so === 0) {
    setStartAfterLastContent(range, sPreText);
  }

  if(ec.nodeType === Node.TEXT_NODE && ePreText !== ec && eo === 0) {
    range_setEndAfterLastContent(range, ePreText);
  }
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/get.js





function getTextFromNodeOrFrag(frag) {
  if(!(frag instanceof DocumentFragment) && !(frag instanceof Node)) {
    console.error(`get text from fragment: argument-${frag} is not a fragment or node, return empty string`);
    return '';
  }

  let text = '';

  frag.childNodes.forEach(node => {
    if(node.nodeType === Node.TEXT_NODE) {
      text = text.concat(node.nodeValue);
    } else if(node.nodeType === Node.ELEMENT_NODE) {
      text = text.concat(getTextFromNodeOrFrag(node));
    }
  });

  if(frag instanceof Node && frag.nodeType === Node.ELEMENT_NODE && config_paraTagNames.includes(frag.tagName)) {
    text = text.concat('\n');
  }

  return text;
}

function get_getParaListFromNodeOrFrag(node) {
  if(!node) return [];
  if(node.nodeType !== Node.ELEMENT_NODE && !(node instanceof DocumentFragment)) return [];
  function getParaListHelp(node, paras = []) {
    if(config_paraTagNames.includes(node.tagName)) paras.push(node);
    else {
      node.childNodes.forEach(node => {
        getParaListHelp(node, paras);
      })
    }
  }
  let paras = [];
  getParaListHelp(node, paras);
  return paras;
}

function getContentNodesFromNodeOrFrag(node) {
  if(!node) {
    console.warn(`getContentNodes: node-${node} is not a node`);
    return [];
  }
  if(node.nodeType !== Node.ELEMENT_NODE && !(node instanceof DocumentFragment)){
    console.warn(`getContentNodes: node-${node} is not a node`);
    return [];
  } 
  function getContentNodesHelp(node, texts = []) {
    if(node.nodeType === Node.TEXT_NODE) texts.push(node);
    else if(node.nodeType === Node.ELEMENT_NODE && autoCloseTagNames.includes(node.tagName)) {
      texts.push(node);
    } else {
      node.childNodes.forEach(node => {
        getContentNodesHelp(node, texts);
      })
    }
  }
  let texts = [];
  getContentNodesHelp(node, texts);
  return texts;
}

function getContentNodesFromRange(range) {
  ensureSelectContent(range);
  let sc = range.startContainer, ec = range.endContainer,
    so = range.startOffset, eo = range.endOffset;
  let ranges = [];

  if(sc === ec) {
    ranges.push(range.cloneRange());
  } else {
    let head = new Range();
    head.setStart(sc, so);
    setEndAfterLastContent(head, sc);
    ranges.push(head);

    let LCA = findLCA(sc, ec);
    let texts = getContentNodesFromNodeOrFrag(LCA);
    let startIdx = texts.indexOf(sc), endIdx = texts.indexOf(ec);
    for(let i = startIdx + 1; i < endIdx; i++) {
      let bodyText = new Range();
      bodyText.selectNodeContents(texts[i]);
      ranges.push(bodyText);
    }

    let tail = new Range();
    tail.setEnd(ec, eo);
    setStartBeforeFirstContent(tail, ec);
    ranges.push(tail);
  }

  return ranges;
}

function getTextNodesFromRange(range) {
  assert_ensureSelectContent(range);
  let sc = range.startContainer, ec = range.endContainer,
    so = range.startOffset, eo = range.endOffset;
  let ranges = [];

  if(sc === ec) {
    ranges.push(range.cloneRange());
  } else {
    let head = new Range();
    head.setStart(sc, so);
    range_setEndAfterLastContent(head, sc);
    ranges.push(head);

    let LCA = find_findLCA(sc, ec);
    let texts = getContentNodesFromNodeOrFrag(LCA);
    let startIdx = texts.indexOf(sc), endIdx = texts.indexOf(ec);
    for(let i = startIdx + 1; i < endIdx; i++) {
      let bodyText = new Range();
      bodyText.selectNodeContents(texts[i]);
      ranges.push(bodyText);
    }

    let tail = new Range();
    tail.setEnd(ec, eo);
    range_setStartBeforeFirstContent(tail, ec);
    ranges.push(tail);
  }

  return ranges;
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/find.js




// para
function findPara(node) {
  if(!node) return null;
  let res = node;
  while( res && 
    !(res.nodeType === Node.ELEMENT_NODE && (config_paraTagNames.includes(res.tagName))
      || blockTagNames.includes(res.tagName))) {
    res = res.parentNode;
  }
  return res;
}

function findNextPara(node, root) {
  let para = findPara(node);
  let paraList = getParaListFromNodeOrFrag(root);
  let paraArr = Array.from(paraList);
  let paraIdx = paraArr.indexOf(para);
  if(paraIdx === -1) return undefined;
  if(paraIdx < paraArr.length - 1) {
    return paraArr[paraIdx + 1];
  } else {
    return null;
  }
}

function findPreviousPara(node, root) {
  let para = findPara(node);
  let paraList = get_getParaListFromNodeOrFrag(root);
  let paraArr = Array.from(paraList);
  let paraIdx = paraArr.indexOf(para);
  if(paraIdx === -1) return undefined;
  if(paraIdx > 0) {
    return paraArr[paraIdx - 1];
  } else {
    return null;
  }
}

// offspring
function findFirstLeaf(node) {
  if(!node || !(node instanceof Node)) {
    console.error(`find first leaf: node-${node} is not a node, return null`);
    return null;
  }

  if(node.nodeType !== Node.ELEMENT_NODE) return node;
  else {
    let res = node;
    while(res.firstChild) res = res.firstChild;
    return res;
  }
}

function findLastLeaf(node) {
  if(!node || !(node instanceof Node)) {
    console.error(`find last leaf: node-${node} is not a node, return null`);
    return null;
  }

  if(node.nodeType !== Node.ELEMENT_NODE) return node;
  else {
    let res = node;
    while(res.lastChild) res = res.lastChild;
    return res;
  }
}

// block
function findBlock(node, root) {
  if(!node) return null;
  let res = node;
  while( res && res !== root &&
    !(res.nodeType === Node.ELEMENT_NODE && blockTagNames.includes(res.tagName))) {
    res = res.parentNode;
  }
  return res;
}

function findCode(range) {
  if(range instanceof Range) {
    let sc = range.startContainer, ec = range.endContainer;

    let sb = findBlock(sc), eb = findBlock(ec);

    if(sb === eb && sb.tagName === 'CODE') return sb;
    return null;
  } else if(range instanceof Node) {
    let block = findBlock(range);

    if(block.tagName === "CODE") return block;
    else return null;
  } else {
    console.warn(`find code: range-${range} is not a range or a node, return null`);
    return null;
  }
}

// text
function findPreviousContent(node) {
  let para = findPara(node);
  let contetNodes = getContentNodesFromNodeOrFrag(para);
  let idx = contetNodes.indexOf(node);
  if(idx > 0) return contetNodes[idx - 1];
  else return contetNodes[0];
}

// element
function findEle(node) {
  if(!(node instanceof Node)) {
    return null;
  }
  while(node && node.nodeType !== Node.ELEMENT_NODE) {
    node = node.parentNode;
  }
  return node;
}

function findPath(node, root) {
  let path = [node];
  while(node.parentNode && node.parentNode !== root) {
    path.push(node.parentNode);
    node = node.parentNode;
  }
  // console.log(node, root, path);
  return path;
}

function find_findLCA(node1, node2, root) {
  let path1 = findPath(node1, root);
  let path2 = findPath(node2, root);
  let flag = false, res = null;
  path1.forEach(node => {
    if(!flag && path2.includes(node)) {
    	flag = true;
    	res = node;
    }
  })
  return res;
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/range.js




function normalizeRange(range) {
  // console.log('before normalize', range.cloneRange());

  assert_ensureSelectContent(range);
  ensureSelectPreContent(range);

  // console.log('after normalize', range.cloneRange());
}

function range_setStartBeforeFirstContent(range, node) {
  if(node.nodeType === Node.TEXT_NODE) {
    range.setStart(node, 0);
  }
  else {
    let contentNodes = getContentNodesFromNodeOrFrag(node);

    if(contentNodes.length === 0) {
      let head = findFirstLeaf(node);
      range.setStart(head, 0);
      return;
    }

    let head = contentNodes[0], parent = head.parentNode;
    if(head.nodeType === Node.TEXT_NODE) {
      range.setStart(head, 0);
    } else {
      range.setStart(parent, Array.from(parent.childNodes).indexOf(head));
    }
  }
}

function range_setEndAfterLastContent(range, node) {
  if(node.nodeType === Node.TEXT_NODE) {
    range.setEnd(node, node.nodeValue.length);
  }
  else {
    let contentNodes = getContentNodesFromNodeOrFrag(node);

    if(contentNodes.length === 0) {
      let tail = findLastLeaf(node);
      range.setEnd(tail, 0);
      return;
    }

    let tail = contentNodes[contentNodes.length - 1], parent = tail.parentNode;
    if(tail.nodeType === Node.TEXT_NODE) {
      range.setEnd(tail, tail.length);
    } else {
      range.setEnd(parent, Array.from(parent.childNodes).indexOf(tail) + 1);
    }
  }
}

function setStartAfterLastContent(range, node) {
  if(node.nodeType === Node.TEXT_NODE) {
    range.setStart(node, node.nodeValue.length);
  }
  else {
    let contentNodes = getContentNodesFromNodeOrFrag(node);

    if(contentNodes.length === 0) {
      let tail = findLastLeaf(node);
      range.setStart(tail, 0);
      return;
    }

    let tail = contentNodes[contentNodes.length - 1], parent = tail.parentNode;
    if(tail.nodeType === Node.TEXT_NODE) {
      range.setStart(tail, tail.length);
    } else {
      range.setStart(parent, Array.from(parent.childNodes).indexOf(tail) + 1);
    }
  }
}

function setEndBeforeFirstContent(range, node) {
  if(node.nodeType === Node.TEXT_NODE) {
    range.setEnd(node, 0);
  }
  else {
    let contentNodes = getContentNodesFromNodeOrFrag(node);

    if(contentNodes.length === 0) {
      let head = findFirstLeaf(node);
      range.setEnd(head, 0);
      return;
    }

    let head = contentNodes[0], parent = head.parentNode;
    if(head.nodeType === Node.TEXT_NODE) {
      range.setEnd(contentNodes[0], 0);
    } else {
      range.setEnd(parent, Array.from(parent.childNodes).indexOf(head));
    }
  }
}

function selectHead(range, node) {
  ensureContent(node);
  if(node.nodeType === Node.TEXT_NODE) {
    range.selectNodeContents(node);
    range.collapse(true);
  } else {
    let texts = getContentNodesFromNodeOrFrag(node);
    range.selectNodeContents(texts[0]);
    range.collapse(true);
  }
}

function selectTail(range, node) {
  ensureContent(node);
  if(node.nodeType === Node.TEXT_NODE) {
    range.selectNodeContents(node);
    range.collapse(false);
  } else {
    let texts = getContentNodesFromNodeOrFrag(node);
    range.selectNodeContents(texts[texts.length - 1]);
    range.collapse(false);
  }
}

function selectBlock(range, node) {
  if(assert_isEmptyNode(node)) {
    let child = node.firstChild;
    let text = document.createTextNode("");
    child.appendChild(text);
    range.selectNodeContents(text);
  } else {
    let texts = getContentNodesFromNodeOrFrag(node);
    let head = texts[0], tail = texts[texts.length - 1],
      headParent = head.parentNode, tailParent = tail.parentNode;
    if(head.nodeType === Node.TEXT_NODE) {
      range.setStart(texts[0], 0);
    } else {
      range.setStart(headParent, Array.from(headParent.childNodes).indexOf(head));
    }

    if(tail.nodeType === Node.TEXT_NODE) {
      range.setEnd(texts[texts.length - 1], texts[texts.length - 1].nodeValue.length);
    } else {
      range.setEnd(tailParent, Array.from(tailParent.childNodes).indexOf(tail) + 1);
    }
  }
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/revoke/record.js


let root;
let selection, range;

const stack = [];
const maxSize = 100;

function setRoot(a){
  if(typeof a === 'string') {
    root = document.querySelector(a);
  }
  else if(a instanceof Node) {
    root = a;
  }
  else {
    console.error(`operation stack set root: root-${root} is not a string or node`);
  }
}

function record() {
  selection = window.getSelection();
  if(!selection.rangeCount) return;
  range = selection.getRangeAt(0);

  let sc = range.startContainer, ec = range.endContainer,
    sp = findPara(sc), ep = findPara(ec),
    sb = findBlock(sc), eb = findBlock(ec);

  let blocks = Array.from(root.children);

  let sidx = sb === root ? blocks.indexOf(sp) : blocks.indexOf(sb);
  let eidx = eb === root ? blocks.indexOf(ep) : blocks.indexOf(eb);

  let start = blocks.slice(0, sidx).reduce((a, b) => {
    return a + b.outerHTML.length;
  }, 0);
  let end = blocks.slice(eidx + 1, blocks.length).reduce((a, b) => {
    return a + b.outerHTML.length;
  }, 0);
  let content = blocks.slice(sidx, eidx + 1).reduce((a, b) => {
    return a + b.outerHTML
  }, "");

  let record = {
    start,
    end,
    content
  };

  stack.push(record);

  if(stack.length > maxSize) {
    stack.unshift();
  }
}

function revoke() {
  if(!stack.length) return;

  let r = stack.pop();
  let html = root.innerHTML;
  let before = html.slice(0, r.start);
  let after = r.end === 0 ? '' : html.slice(-1 * r.end);
  root.innerHTML = before + r.content + after;

  root.blur();
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/handlers/keydown.js







let recordInputFlag = true, recordDelFlag = true;

function flagRecord(event) {
  if(!isInputEvent(event)) recordInputFlag = true;
  if(!isDelEvent(event)) recordDelFlag = true;

  if(event.key === ' ') {
    record();
  }
  else if(isInputEvent(event)) {
    if(recordInputFlag) {
      recordInputFlag = false;
      record();
    }
  } else if(isDelEvent(event)) {
    if(recordDelFlag) {
      recordDelFlag = false;
      record();
    }
  }
}

let keydown_root;
let keydown_selection, keydown_range;

function keydown_setRoot(a){
  if(typeof a === 'string') keydown_root = document.querySelector(a);
  else if(a instanceof Node) keydown_root = a;
  else {
    console.error(`keydown handler set root: root-${keydown_root} is not a string or node`);
  }
}

function isDefaultKey(event) {
  if(!(event instanceof KeyboardEvent)) {
    console.warn(`is default key: event-${event} is not keyboardevent, return false`);
    return false;
  }

  const defaultKyes = ['v', 'c', 'z', 'a'];

  return event.ctrlKey && defaultKyes.includes(event.key);
}

function isInputEvent(event) {
  // 'Process' for inputting method
  return event instanceof KeyboardEvent && 
    (event.key.length === 1 || event.key === 'Tab' || event.key === 'Process');
}

function isDelEvent(event) {
  return event instanceof KeyboardEvent && 
    (event.key === 'Backspace');
}

// merge
function mergeNode(node1, node2, flag) {
  if(!flag) {
    while(node2.firstChild) {
      node1.appendChild(node2.firstChild);
    }
    node2.parentNode.removeChild(node2);
  }
  else {
    while(node1.firstChild) {
      node2.insertBefore(node1.lastChild, node2.firstChild);
    }
    node1.parentNode.removeChild(node1);
  }
}

function handlerEnter(event) {
  event.preventDefault();

  if(keydown_range.startContainer === keydown_range.endContainer 
    && keydown_range.startOffset === keydown_range.endOffset) {

    const codeBlock = findCode(keydown_range);

    let curNode = keydown_range.endContainer;
    let curPara = findPara(curNode);
    keydown_range.setEndAfter(curPara);

    let newParaFrag = keydown_range.extractContents();
    let newPara = newParaFrag.firstChild;

    newPara.style = {};

    keydown_range.insertNode(newPara);

    if(codeBlock) {
      curPara.innerHTML = highlight.highlight(curPara.innerText, {
        language: codeBlock.dataset.lang
      }).value;
    }

    selectHead(keydown_range, newPara);
  }
}

function handlerBackspace(event) {
  event.preventDefault();

  if(keydown_range.toString()) {
    let sc = keydown_range.startContainer;
    let so = keydown_range.startOffset;
    let ec = keydown_range.endContainer;
    let sp = findPara(sc);
    let ep = findPara(ec);
    keydown_range.extractContents();
    if(sp !== ep) {
      let range = new Range();
      range.selectNodeContents(ep);
      let frag = range.extractContents();
      sp.appendChild(frag);
      ep.parentNode.removeChild(ep);
    }
    keydown_range.setStart(sc, so);
    keydown_range.setEnd(sc, so);
  }
  else {
    let node = keydown_range.startContainer;
    let para = findPara(node);
    let prePara = findPreviousPara(node, keydown_root);
    let head = para.firstChild;

    if(keydown_range.startOffset === 0) {
      if(isBlockFirstPara(para) && findBlock(node) !== keydown_root) {
        let block = findBlock(node);
        let sib = block.nextSibling;

        while(block.firstChild) {
          block.parentNode.insertBefore(block.firstChild, sib);
        }

        let replacePara = document.createElement(baseParaTagName);
        block.parentNode.insertBefore(replacePara, block);
        block.parentNode.removeChild(block);
        keydown_range.selectNodeContents(replacePara);
        keydown_range.collapse();
      }
      else if(prePara) {
        let head = para.firstChild
        while(para.firstChild) {
          prePara.appendChild(para.firstChild);
        }
        para.parentNode.removeChild(para);
        if(head) selectHead(keydown_range, head);
        else selectTail(keydown_range, prePara);
      }
    } else if(keydown_range.startOffset === 1) {
      keydown_range.setStart(node, 0);
      keydown_range.extractContents();
    } else {
      let sc = keydown_range.startContainer, so = keydown_range.startOffset;
      keydown_range.setStart(sc, so - 1);
      keydown_range.extractContents();
    }
  }
}

function handlerInput(event) {
  if(event.key.length === 1) {
    handlerInputLetter(event);
  } else if(event.key === 'Tab') {
    handlerInputTab(event);
  }
  // inputting method do nothing
}

function handlerInputLetter(event) {
  event.preventDefault();
  let sc = keydown_range.startContainer, ec = keydown_range.endContainer;
  if(sc === ec) {
    keydown_range.extractContents();
    keydown_range.insertNode(document.createTextNode(event.key));
    keydown_range.collapse(false);
    return;
  } else {
    keydown_range.extractContents();
    let newTextNode =  document.createTextNode(event.key);
    sc.appendChild(newTextNode);
    mergeNode(sc, ec);
    selectTail(keydown_range, newTextNode);
  }
}

function handlerInputTab(event) {
  event.preventDefault();
  let sc = keydown_range.startContainer, ec = keydown_range.endContainer;
  if(sc === ec) {
    keydown_range.extractContents();
    keydown_range.insertNode(document.createTextNode('\t'));
    keydown_range.collapse(false);
    return;
  } else {
    keydown_range.extractContents();
    let newTextNode =  document.createTextNode('\t');
    sc.appendChild(newTextNode);
    mergeNode(sc, ec);
    selectTail(keydown_range, newTextNode);
  }
}

function keydownHandler(event) {
  if(event.ctrlKey && event.key === 'z') {
    event.preventDefault();
    revoke();
    return;
  }

  if(event.ctrlKey && event.key === 's') {
    event.preventDefault();
    window.parent.postMessage(JSON.stringify({
      type: 'store'
    }));
    return;
  }

  if(event.ctrlKey && event.key === 'a') {
    event.preventDefault();
    keydown_range.selectNodeContents(keydown_root);
    normalizeRange(keydown_range);
    return;
  }

  if(isDefaultKey(event)) return;

  keydown_selection = window.getSelection();
  if(!keydown_selection.rangeCount) return;
  keydown_range = keydown_selection.getRangeAt(0);

  flagRecord(event);

  keydown_root.focus();
  normalizeRange(keydown_range);

  if(event.key === "Enter") {
    handlerEnter(event);
  } 
  else if (event.key === 'Backspace') {
    handlerBackspace(event);
  }
  else if(isInputEvent(event)) {
    handlerInput(event);
  }
  ensureNewLine(keydown_root);
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/clear.js



function clearEmptyNode(node) {
  if(!node || !(node instanceof Node)){
    console.error(`clear empty node: ${node} is not a node`);
    return;
  }

  if(assert_isEmptyNode(node)) {
    if(node.parentNode) {
      node.parentNode.removeChild(node);
    }
  }
}

// merge same type node
function normalize(root) {
  if(!root || !(root instanceof Node)){
    console.error(`normalize: ${root} is not a node`);
    return;
  }
	const q = [root];
	while(q.length) {
		let cur = q.shift();
		let sib = q[0];
		if(!q.length || cur.parentNode !== sib.parentNode) {
			if(cur.nodeType === Node.ELEMENT_NODE) cur.childNodes.forEach(node => {
				q.push(node);
			});
			continue;
		} else {
			const parent = cur.parentNode;
			while (cur.nodeType === sib.nodeType && cur.parentNode === sib.parentNode) {
				if(cur.nodeType === Node.ELEMENT_NODE && cur.tagName === sib.tagName
          && inlineTagNames.some(tag => tag === cur.tagName)) {
          let sibChildNodes = sib.childNodes;
          while(sibChildNodes.length) {
            cur.appendChild(sibChildNodes[0]);
          }
					parent.removeChild(sib);
					q.shift();
				} else if (cur.nodeType === Node.TEXT_NODE) {
					cur.nodeValue += sib.nodeValue;
					parent.removeChild(sib);
					q.shift();
				} else {
					break;
				}
				if(!q.length) break;
				else sib = q[0];
			} 
			if (cur.nodeType === Node.ELEMENT_NODE) {
				cur.childNodes.forEach(node => {
					q.push(node);
				});
			}
		}
	}
}

// remove the same tag
function simplify(root) {
  if(!root || !(root instanceof Node)){
    console.error(`simplify: ${root} is not a node`);
    return;
  }
  const q = [root];
  while(q.length) {
    let node = q.shift();
    if(node.nodeType !== Node.ELEMENT_NODE) continue;
    const dict = {};
    let path = node;
    let repeatFlag = false;
    while(path != root) {
      if(dict[path.tagName] && !config_paraTagNames.includes(path.tagName)) {
        repeatFlag = true;
        break;
      } else {
        dict[path.tagName] = true;
        path = path.parentNode;
      }
    }
    if(repeatFlag) {
      let frag = new DocumentFragment();
      let nodes = node.childNodes;
      while(nodes.length) {
        q.push(nodes[0]);
        frag.appendChild(nodes[0]);
      }
      let parent = node.parentNode;
      parent.insertBefore(frag, node);
      parent.removeChild(node);
    } else {
    	node.childNodes.forEach(node => q.push(node));
    }
  }
}

function removeEmpty(root) {
  if(!root || !(root instanceof Node)){
    console.error(`remove empty: ${root} is not a node`);
    return;
  }
  let q = [];
  root.childNodes.forEach(node => q.push(node));
  while(q.length) {
    let node = q.shift();
    if(isEmptyNode(node)) clearEmptyNode(node);
    else {
      node.childNodes.forEach(node => q.push(node));
    }
  }
}

function removeEmptyTagList(node) {
  while(isEmptyNode(node) && !paraTagNames.includes(node.tagName)) node = node.parentNode;
  removeEmpty(node);
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/createElement.js
function createElement(selector) {
  if(typeof selector !== 'string') {
    console.error(`create element: selector-${selector} not string`);
    return;
  }

  let eles = selector.split(/\s*>\s*/);
  eles.forEach((val, idx, arr) => {
    arr[idx] = arr[idx].trim();
  });
  let root;
  if(eles.length === 1) {
    return document.createElement(selector);
  } else {
    eles.reduce((pre, cur) => {
      if(typeof pre === 'string') {
        pre = document.createElement(pre);
        root = pre;
        pre = [pre];
      }
      let resArr = [];
      pre.forEach((parent) => {
        let tuple = cur.split(/\s*\*\s*/);
        if(tuple[1]) tuple[1] = parseInt(tuple[1]);
        else tuple[1] = 1;
        for(let i = 0; i < tuple[1]; i++) {
          let node = document.createElement(tuple[0]);
          parent.appendChild(node);
          resArr.push(node);
        }
      })
      return resArr;
    });
  }
  return root;
}

function createElementPath(selector) {
  if(typeof selector !== 'string') {
    console.error(`create element path: selector-${selector} not string`);
    return;
  }

  let pathTag = selector.split(/\s*>\s*/);
  let path = new Array(pathTag.length);
  pathTag.forEach((tagName, idx) => {
    path[idx] = document.createElement(tagName);
  });
  path.reduce((pre, cur) => {
    pre.appendChild(cur);
  });
  return path;
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/handlers/message.js












let message_root;

const clear = () => {
  simplify(message_root);
  normalize(message_root);
}
let message_selection, message_range;

function message_setRoot(a){
  if(typeof a === 'string') message_root = document.querySelector(a);
  else if(a instanceof Node) message_root = a;
  else {
    console.error(`message handler set root: root-${message_root} is not a string or node`);
  }
}

function addBlock(tag) {
  let newNodes = createElementPath(tag.name), newNode = newNodes[0];
  let startPara = findPara(message_range.startContainer);
  let endPara = findPara(message_range.endContainer);

  let startBlock = findBlock(message_range.startContainer, message_root);
  let endBlock = findBlock(message_range.endContainer, message_root);
  if(startBlock === endBlock && startBlock !== message_root) {
    alert('不能嵌套');
    return;
  }
  let frag = message_range.extractContents();

  if(startPara === endPara) {
    message_range.setEndAfter(endPara); 
    // split a paragraph to insert a blockTag
    message_range.insertNode(message_range.extractContents());

    // insert new node
    newNodes[newNodes.length - 1].appendChild(frag);
  } else {
    let paraList = get_getParaListFromNodeOrFrag(frag);
    let paraTagName = newNodes[newNodes.length - 1].tagName;
    paraList.forEach((para, idx) => {
      if(para.tagName !== paraTagName) {
        let paraRange = new Range();
        paraRange.selectNodeContents(paraList[idx]);
        let paraContent = paraRange.extractContents();
        paraList[idx] = document.createElement(paraTagName);
        paraList[idx].appendChild(paraContent);
      }
    })
    paraList.forEach(para => {
      newNode.appendChild(para);
    });
  }

  if(newNode.childNodes.length > 1) newNode.removeChild(newNode.firstChild);
  message_range.insertNode(newNode);

  if(newNode.tagName === 'CODE') {
    addLangSelectListener(newNode);
  }

  selectBlock(message_range, newNode);

  clearEmptyNode(newNode.previousSibling);
  clearEmptyNode(newNode.nextSibling);
}

function addImg(tag) {
  let newNodes = createElementPath(tag.name), newNode = newNodes[0];
  let startPara = findPara(message_range.startContainer);
  let endPara = findPara(message_range.endContainer);

  let img = document.createElement('img');
  img.src = tag.url;
  img.style.width = '50%';
  img.style.verticalAlign = 'bottom';
  let newPara = document.createElement(baseParaTagName);
  newPara.style.textAlign = 'center';
  newPara.appendChild(img);
  if(startPara === endPara) {
    message_range.extractContents();
    message_range.setEndAfter(startPara);
    message_range.insertNode(message_range.extractContents());
  } else {
    message_range.extractContents();
  }
  startPara.parentNode.insertBefore(newPara, startPara.nextSibling);

  selectBlock(message_range, newPara);
}

function addLink(tag) {
  let newNodes = createElementPath(tag.name), newNode = newNodes[0];
  let startPara = findPara(message_range.startContainer);
  let endPara = findPara(message_range.endContainer);
  
  assert_ensureSelectContent(message_range);

  message_range.extractContents();

  assert_ensureSelectContent(message_range);

  let a = document.createElement('a');
  a.href = tag.href;
  a.appendChild(document.createTextNode(tag.cover));

  a.addEventListener('click', () => {
    window.open(a.href);
  })

  message_range.insertNode(a);
}

function addInline(tag) {
  let textRanges = getTextNodesFromRange(message_range);

  textRanges.forEach(range => {
    let frag = range.extractContents();
    let pack = document.createElement(tag.name);
    if(tag.style) fillStyle_fillStyle(pack, tag.style);
    pack.appendChild(frag);
    range.insertNode(pack);
  });

  let head = textRanges[0], tail = textRanges[textRanges.length - 1];
  message_range.setStart(head.startContainer, head.startOffset);
  message_range.setEnd(tail.endContainer, tail.endOffset);
}

function addTag(tag) {
  message_selection = window.getSelection();
  if(!message_selection.rangeCount) return;
  message_range = message_selection.getRangeAt(0);

  record();
  normalizeRange(message_range);

  if(tag.name === 'img') {
    addImg(tag);
    return;
  }

  if(tag.name === 'a') {
    addLink(tag);
    return;
  }

  if(tag.type === 'block') {
    addBlock(tag);
  } 
  else if(tag.type === 'inline') {
    addInline(tag);
  }
}

function messageHandler(event) {
  try{
    JSON.parse(event.data);
  } catch {
    return;
  }
  let operation = JSON.parse(event.data);
  if(operation.type === 'addTag') {
    addTag(operation.tag);
    ensureNewLine(message_root);
  }
  else if(operation.type === 'getArticle') {
    clear();
    window.parent.postMessage(
      JSON.stringify({content: message_root.innerHTML, type: 'sendArticle', text: message_root.innerText}),
    );
  }
  else if(operation.type === 'fillDraft') {
    message_root.innerHTML = operation.draft;
    traceCode(message_root);
  }
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/handlers/paste.js




let paste_root;
let paste_selection, paste_range;

function paste_setRoot(a){
  if(typeof a === 'string') paste_root = document.querySelector(a);
  else if(a instanceof Node) paste_root = a;
  else {
    console.error(`paste handler set root: root-${paste_root} is not a string or node`);
  }
}

function pasteHandler(event){
  event.preventDefault();

  record();

  paste_selection = window.getSelection();
  if(!paste_selection.rangeCount) return;
  paste_range = paste_selection.getRangeAt(0);

  paste_range = window.getSelection().getRangeAt(0);
  let startPara = findPara(paste_range.startContainer);
  let endPara = findPara(paste_range.endContainer);

  const paraTagName = startPara.tagName;

  let data = event.clipboardData.getData('text');
  let texts = data.split(/\r?\n/).reverse();

  if(texts.length === 0) {
    return;
  }
  else if (texts.length === 1) {
    paste_range.extractContents();
    let newTextNode = document.createTextNode(texts[0]);
    startPara.appendChild(newTextNode);

    let codeBlock = findCode(startPara);
    if(codeBlock) {
      startPara.innerHTML = highlight.highlight(startPara.innerText, {
        language: codeBlock.dataset.lang
      }).value;
    }

    paste_range.selectNodeContents(newTextNode);
    paste_range.collapse();
  }
  else {
    paste_range.extractContents();
    if(startPara === endPara) {
      paste_range.setEndAfter(startPara);
      paste_range.insertNode(paste_range.extractContents());
      endPara = startPara.nextSibling;
    }
    let firstLine = document.createTextNode(texts.pop());
    let lastLine = document.createTextNode(texts.shift());
    
    startPara.appendChild(firstLine);
    let codeBlock = findCode(startPara);
    if(codeBlock) {
      startPara.innerHTML = highlight.highlight(startPara.innerText, {
        language: codeBlock.dataset.lang
      }).value;
    }

    endPara.insertBefore(lastLine, endPara.firstChild);
    codeBlock = findCode(endPara);
    if(codeBlock) {
      endPara.innerHTML = highlight.highlight(endPara.innerText, {
        language: codeBlock.dataset.lang
      }).value;
    }

    codeBlock = findCode(startPara);
    texts.forEach(text => {
      let para = document.createElement(paraTagName);
      if(codeBlock) {
        para.innerHTML = highlight.highlight(text, {
          language: codeBlock.dataset.lang
        }).value;
      } else {
        para.innerText = text;
      }
      startPara.parentNode.insertBefore(para, startPara.nextSibling);
    })

    paste_range.setStart(firstLine, 0);
    paste_range.setEnd(lastLine, lastLine.length);
    paste_range.collapse();
  }
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/handlers/copy.js



let copy_root;
let copy_selection, copy_range;

function copy_setRoot(a){
  if(typeof a === 'string') copy_root = document.querySelector(a);
  else if(a instanceof Node) copy_root = a;
  else {
    console.error(`copy handler set root: root-${copy_root} is not a string or node`);
  }
}

function copyHandler(event) {
  event.preventDefault();

  record();

  copy_selection = window.getSelection();
  if(!copy_selection.rangeCount) return;
  copy_range = copy_selection.getRangeAt(0);

  let frag = copy_range.cloneContents();

  let res = getTextFromNodeOrFrag(frag);

  console.log(res);
  event.clipboardData.setData('text/plain', res);
}


;// CONCATENATED MODULE: ./src/pages/RTF/utils/init/init.js









function init(root) {

  // clear
  root.innerHTML = '';

  // RTF
  const RTF = document.createElement('DIV');
  RTF.id = 'RTF';
  RTF.contentEditable = true;
  RTF.appendChild(document.createElement(baseParaTagName));
  root.appendChild(RTF);

  // langSelect
  const langSelect =  document.createElement('DIV');
  langSelect.id = 'langSelect';
  root.appendChild(langSelect);

  initLangSelect(langSelect, (lang, codeBlock) => {
    codeBlock.dataset.lang = lang;
  
    for(let i = 0; i < codeBlock.children.length; i++) {
      let child = codeBlock.children.item(i);
      let html = highlight.highlight(child.innerText, {
        language: codeBlock.dataset.lang
      }).value;
      child.innerHTML = html;
    }
  });
  
  keydown_setRoot(RTF);
  message_setRoot(RTF);
  paste_setRoot(RTF);
  copy_setRoot(RTF);
  setRoot(RTF);
  
  document.addEventListener('keydown', keydownHandler);
  
  document.addEventListener('paste', pasteHandler);
  
  window.addEventListener('message', messageHandler);

  document.addEventListener('copy', copyHandler);
}

/* harmony default export */ const init_init = (init);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/RTF/RTF.vue?vue&type=script&lang=js



  /* harmony default export */ const RTFvue_type_script_lang_js = ({
    mounted() {
      init_init(document.body);
    }
  });

;// CONCATENATED MODULE: ./src/pages/RTF/RTF.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/pages/RTF/RTF.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(RTFvue_type_script_lang_js, [['render',render]])

/* harmony default export */ const RTF = (__exports__);
// EXTERNAL MODULE: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
var runtime_dom_esm_bundler = __webpack_require__(9963);
;// CONCATENATED MODULE: ./src/pages/RTF/main.js



const rtf = (0,runtime_dom_esm_bundler/* createApp */.ri)(RTF);

rtf.mount(document.body);

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = __webpack_modules__;
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/chunk loaded */
/******/ 	(() => {
/******/ 		var deferred = [];
/******/ 		__webpack_require__.O = (result, chunkIds, fn, priority) => {
/******/ 			if(chunkIds) {
/******/ 				priority = priority || 0;
/******/ 				for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
/******/ 				deferred[i] = [chunkIds, fn, priority];
/******/ 				return;
/******/ 			}
/******/ 			var notFulfilled = Infinity;
/******/ 			for (var i = 0; i < deferred.length; i++) {
/******/ 				var [chunkIds, fn, priority] = deferred[i];
/******/ 				var fulfilled = true;
/******/ 				for (var j = 0; j < chunkIds.length; j++) {
/******/ 					if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
/******/ 						chunkIds.splice(j--, 1);
/******/ 					} else {
/******/ 						fulfilled = false;
/******/ 						if(priority < notFulfilled) notFulfilled = priority;
/******/ 					}
/******/ 				}
/******/ 				if(fulfilled) {
/******/ 					deferred.splice(i--, 1)
/******/ 					var r = fn();
/******/ 					if (r !== undefined) result = r;
/******/ 				}
/******/ 			}
/******/ 			return result;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	(() => {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/jsonp chunk loading */
/******/ 	(() => {
/******/ 		// no baseURI
/******/ 		
/******/ 		// object to store loaded and loading chunks
/******/ 		// undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ 		// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ 		var installedChunks = {
/******/ 			814: 0
/******/ 		};
/******/ 		
/******/ 		// no chunk on demand loading
/******/ 		
/******/ 		// no prefetching
/******/ 		
/******/ 		// no preloaded
/******/ 		
/******/ 		// no HMR
/******/ 		
/******/ 		// no HMR manifest
/******/ 		
/******/ 		__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
/******/ 		
/******/ 		// install a JSONP callback for chunk loading
/******/ 		var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ 			var [chunkIds, moreModules, runtime] = data;
/******/ 			// add "moreModules" to the modules object,
/******/ 			// then flag all "chunkIds" as loaded and fire callback
/******/ 			var moduleId, chunkId, i = 0;
/******/ 			if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/ 				for(moduleId in moreModules) {
/******/ 					if(__webpack_require__.o(moreModules, moduleId)) {
/******/ 						__webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ 					}
/******/ 				}
/******/ 				if(runtime) var result = runtime(__webpack_require__);
/******/ 			}
/******/ 			if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ 			for(;i < chunkIds.length; i++) {
/******/ 				chunkId = chunkIds[i];
/******/ 				if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ 					installedChunks[chunkId][0]();
/******/ 				}
/******/ 				installedChunks[chunkId] = 0;
/******/ 			}
/******/ 			return __webpack_require__.O(result);
/******/ 		}
/******/ 		
/******/ 		var chunkLoadingGlobal = self["webpackChunktoknow"] = self["webpackChunktoknow"] || [];
/******/ 		chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ 		chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module depends on other loaded chunks and execution need to be delayed
/******/ 	var __webpack_exports__ = __webpack_require__.O(undefined, [740], () => (__webpack_require__(2446)))
/******/ 	__webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/ 	
/******/ })()
;